package com.kakarote.crm9.erp.ding.service;

import com.jfinal.plugin.activerecord.Db;
import com.kakarote.crm9.erp.ding.entity.DingAlluser;
import com.kakarote.crm9.erp.ding.entity.DingRu;
import com.kakarote.crm9.erp.ding.entity.DingRuAll;
import com.kakarote.crm9.erp.ding.entity.DingRuRoler;
import com.kakarote.crm9.utils.R;

import java.util.List;

public class DingRuService {

    public Integer getSum(String mobile){
        Integer ss = Db.queryInt(Db.getSql("dingRu.ding.MtoSum"),mobile);
        return ss;
    }
    public DingRu getRu(String mobile){
       DingRu dingRu = DingRu.dao.findFirst(Db.getSql("dingRu.ding.MtoRu"),mobile);
        return dingRu;
    }
    public Integer getSums(Integer ru_id){
        Integer ss = Db.queryInt(Db.getSql("dingRu.ding.IdtoSum"),ru_id);
        return ss;
    }
    public DingRuRoler getRuRoler(String id_one){
        DingRuRoler dingRuRoler = DingRuRoler.dao.findFirst(Db.getSql("dingRu.ding.IdtoRu"),id_one);
        return dingRuRoler;
    }
    public DingRuRoler getTwo(String id_two){
        DingRuRoler dingRuRoler = DingRuRoler.dao.findFirst(Db.getSql("dingRu.ding.twoOnRu"),id_two);
        return dingRuRoler;
    }
    public Integer getAllsum(String mobile){
        Integer ss = Db.queryInt(Db.getSql("dingRu.ding.MtoSumAll"),mobile);
        return ss;
    }
    public DingRuAll getAll(String mobile){
        DingRuAll dingRuAll = DingRuAll.dao.findFirst(Db.getSql("dingRu.ding.MToAll"),mobile);
        return dingRuAll;
    }
    public DingRuAll getAlls(String id){
        DingRuAll dingRuAll = DingRuAll.dao.findFirst(Db.getSql("dingRu.ding.getAlls"),id);
        return dingRuAll;
    }

}
